// file module.exports = require("../config.build");

var path = require('path');

const rename = require("gulp-rename");

var ret = {};

ret.srcroot = __dirname;

var isWin = /^win/.test(process.platform);

if (isWin) {
    // windows 处理
} else {
    
}

ret.watchPath = path.join(__dirname, "../");

ret.destroot = "";

ret.babelenv = {
    "targets": {
        "browsers": ["IE >= 8"]
    }
};

ret.babelplugins = [
    ["transform-runtime", {
        "helpers": false,
        "polyfill": false,
        "regenerator": true
    }]
];

ret.sassresolve = function (sassbundler) {
    return sassbundler.pipe(rename(function (path) {
        path.extname = ".wxss"
    }))
};

ret.browsers = ['safari >= 8'];

ret.sasspath = path.join(ret.srcroot, "/sass/**/*.scss");

ret.csspath = path.join(ret.destroot, "/");

ret.pagename = "aux-image";

ret.nosourcemap = false;

ret.compileoptions = {

};

ret.webpackconfig = {
    plugins: {
        "CopyWebpackPlugin": [
            [
                { from: '**/*.html', to: "../web", context: 'src' }
            ], {}
        ]
    }
};


ret.uglify = true;

ret.espath = path.join(ret.srcroot, `/webcomponents/${ret.pagename}/index.mjs`);

ret.jspath = "./";

module.exports = ret;